COVID 19 Analysis in India¶
This dataset depicts the daily confirmed and daily deaths recorded due to COVID-19 in India.
In [ ]:
import pandas as pd
import numpy as np
data = pd.read_csv("covid19_india.csv")
print(data.head())
data.describe()
Date Date_YMD Daily Confirmed Daily Deceased 0 30 January 2020 2020-01-30 1 0 1 31 January 2020 2020-01-31 0 0 2 1 February 2020 2020-02-01 0 0 3 2 February 2020 2020-02-02 1 0 4 3 February 2020 2020-02-03 1 0
Out[ ]:
| Daily Confirmed | Daily Deceased | |
|---|---|---|
| count | 720.000000 | 720.000000 |
| mean | 52637.915278 | 675.901389 |
| std | 78522.746943 | 932.895333 |
| min | 0.000000 | 0.000000 |
| 25% | 10419.250000 | 159.000000 |
| 50% | 27383.000000 | 387.000000 |
| 75% | 54300.750000 | 734.750000 |
| max | 414280.000000 | 6139.000000 |
In [ ]:
import plotly.express as px
fig = px.bar(data, x='Date_YMD', y='Daily Confirmed')
fig.show(renderer='notebook')
In [ ]:
fig = px.bar(data, x='Date_YMD', y='Daily Deceased')
fig.show(renderer='notebook')
Overlaying the Confirmed and Death graphs over each other to see trends¶
In [ ]:
import plotly.express as px
from plotly.subplots import make_subplots
import plotly.graph_objects as go
# Create figure with subplots
fig = make_subplots(specs=[[{"secondary_y": True}]])
# Add traces for Daily Confirmed and Daily Deceased
fig.add_trace(
go.Bar(x=data['Date_YMD'], y=data['Daily Confirmed'], name='Daily Confirmed'),
secondary_y=False,
)
fig.add_trace(
go.Bar(x=data['Date_YMD'], y=data['Daily Deceased'], name='Daily Deceased'),
secondary_y=True,
)
# Update layout
fig.update_layout(
title_text="Daily Confirmed and Daily Deceased Cases",
xaxis_title="Date",
yaxis_title="Daily Confirmed Cases",
yaxis2_title="Daily Deceased Cases",
)
# Show figure
fig.show(renderer='notebook')
In [ ]: